bitkeeper revision 1.1159.170.68 (41d2b498y1kgB6L3q_YXZmDzui_mSQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 29 Dec 2004 13:43:52 +0000 (13:43 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 29 Dec 2004 13:43:52 +0000 (13:43 +0000)
Pull command-line option declarations to files in which they are used,
rather than having a single list of them in common/kernel.c.

13 files changed:
xen/arch/x86/domain.c
xen/arch/x86/io_apic.c
xen/arch/x86/pdb-stub.c
xen/arch/x86/setup.c
xen/arch/x86/traps.c
xen/common/kernel.c
xen/common/page_alloc.c
xen/common/physdev.c
xen/common/schedule.c
xen/common/trace.c
xen/drivers/char/console.c
xen/drivers/char/serial.c
xen/include/xen/init.h

index 95dc9779a6e14084f6782eba9f67f8120c10a67e..d0cf493522ef8e1227c094ed5524bf18371931f5 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <xen/config.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
 #include <xen/elf.h>
 #include <xen/multicall.h>
 
+/* opt_noreboot: If true, machine will need manual reset on error. */
+static int opt_noreboot = 0;
+boolean_param("noreboot", opt_noreboot);
+
 #if !defined(CONFIG_X86_64BITMODE)
 /* No ring-3 access in initial page tables. */
 #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
@@ -110,7 +115,6 @@ static inline void kb_wait(void)
 
 void machine_restart(char * __unused)
 {
-    extern int opt_noreboot;
 #ifdef CONFIG_SMP
     int cpuid;
 #endif
index 5ab74351b8533cbd866a4cbdb1a1aa874a033b93..5e3fa047f5e5a206d6c57c65b6417f9b6c2ff0bb 100644 (file)
@@ -1830,7 +1830,12 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
 #endif /*CONFIG_ACPI_BOOT*/
 
-extern char opt_leveltrigger[], opt_edgetrigger[];
+/* opt_leveltrigger, opt_edgetrigger: Force an IO-APIC-routed IRQ to be */
+/*                                    level- or edge-triggered.         */
+/* Example: 'leveltrigger=4,5,6,20 edgetrigger=21'. */
+static char opt_leveltrigger[30] = "", opt_edgetrigger[30] = "";
+string_param("leveltrigger", opt_leveltrigger);
+string_param("edgetrigger", opt_edgetrigger);
 
 static int __init ioapic_trigger_setup(void)
 {
index 88aa373122789b55bafda67f8c0594c393756712..bb145aa104aa89504ca45d3120a7b7f4ec5c03c2 100644 (file)
 #include <xen/serial.h>
 #include <xen/softirq.h>
 
+/* opt_pdb: Name of serial port for Xen pervasive debugger (and enable pdb) */
+static unsigned char opt_pdb[10] = "none";
+string_param("pdb", opt_pdb);
+
 #define PDB_DEBUG_TRACE
 #ifdef PDB_DEBUG_TRACE
 #define TRC(_x) _x
@@ -1241,8 +1245,6 @@ void pdb_handle_debug_trap(struct xen_regs *regs, long error_code)
 
 void initialize_pdb()
 {
-    extern char opt_pdb[];
-
     /* Certain state must be initialised even when PDB will not be used. */
     memset((void *) &breakpoints, 0, sizeof(breakpoints));
     INIT_LIST_HEAD(&breakpoints.list);
index d2109f4fb82a18c1b03109ccbcf624f920f2ab4d..d69ff860ff682ad7bf3edd51b903756f4ada67b0 100644 (file)
 #include <asm/domain_page.h>
 #include <asm/pdb.h>
 
+/* opt_noht: If true, Hyperthreading is ignored. */
+int opt_noht = 0;
+boolean_param("noht", opt_noht);
+
+/* opt_noacpi: If true, ACPI tables are not parsed. */
+static int opt_noacpi = 0;
+boolean_param("noacpi", opt_noacpi);
+
+/* opt_nosmp: If true, secondary processors are ignored. */
+static int opt_nosmp = 0;
+boolean_param("nosmp", opt_nosmp);
+
+/* opt_ignorebiostables: If true, ACPI and MP tables are ignored. */
+/* NB. This flag implies 'nosmp' and 'noacpi'. */
+static int opt_ignorebiostables = 0;
+boolean_param("ignorebiostables", opt_ignorebiostables);
+
+/* opt_watchdog: If true, run a watchdog NMI on each processor. */
+static int opt_watchdog = 0;
+boolean_param("watchdog", opt_watchdog);
+
 extern void arch_init_memory(void);
 extern void init_IRQ(void);
 extern void trap_init(void);
 extern void time_init(void);
 extern void ac_timer_init(void);
 extern void initialize_keytable();
-extern int opt_nosmp, opt_watchdog, opt_noacpi;
-extern int opt_ignorebiostables;
 extern int do_timer_lists_from_pit;
 
 char ignore_irq13;             /* set if exception 16 works */
index 6837a143d3d6055efad813581f24c34b5b00d4de..ed996e30a0f97a6a4caf81a79ca2b3a255160944 100644 (file)
 #include <asm/i387.h>
 #include <asm/debugger.h>
 
+/*
+ * opt_nmi: one of 'ignore', 'dom0', or 'fatal'.
+ *  fatal:  Xen prints diagnostic message and then hangs.
+ *  dom0:   The NMI is virtualised to DOM0.
+ *  ignore: The NMI error is cleared and ignored.
+ */
+#ifdef NDEBUG
+char opt_nmi[10] = "dom0";
+#else
+char opt_nmi[10] = "fatal";
+#endif
+string_param("nmi", opt_nmi);
+
 #if defined(__i386__)
 
 #define GUEST_FAULT(_r) (likely(VM86_MODE(_r) || !RING_0(_r)))
index c7e6b27a4ec334f7c81ba4e819fd8e445c4448fd..e7305dbce88942e4c41c147afc923231df7b66ec 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <stdarg.h>
 #include <xen/config.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/spinlock.h>
 #include <asm/domain_page.h>
 #include <public/dom0_ops.h>
 
+/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
+static unsigned int opt_dom0_mem = 16000;
+integer_param("dom0_mem", opt_dom0_mem);
+
+/*
+ * opt_xenheap_megabytes: Size of Xen heap in megabytes, excluding the
+ * pfn_info table and allocation bitmap.
+ */
+static unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
+integer_param("xenheap_megabytes", opt_xenheap_megabytes);
+
 unsigned long xenheap_phys_end;
 
 xmem_cache_t *domain_struct_cachep;
@@ -33,111 +45,14 @@ struct domain *dom0;
 
 vm_assist_info_t vm_assist_info[MAX_VMASST_TYPE + 1];
 
-struct e820entry {
-    unsigned long addr_lo, addr_hi;        /* start of memory segment */
-    unsigned long size_lo, size_hi;        /* size of memory segment */
-    unsigned long type;                    /* type of memory segment */
-};
-
 void start_of_day(void);
 
-/* opt_console: comma-separated list of console outputs. */
-unsigned char opt_console[30] = "com1,vga";
-/* opt_conswitch: a character pair controlling console switching. */
-/* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
-/* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
-/*         boots. Any other value, or omitting the char, enables auto-switch */
-unsigned char opt_conswitch[5] = "a"; /* NB. '`' would disable switching. */
-/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
-unsigned char opt_com1[30] = "", opt_com2[30] = "";
-/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
-unsigned int opt_dom0_mem = 16000;
-/* opt_noht: If true, Hyperthreading is ignored. */
-int opt_noht=0;
-/* opt_noacpi: If true, ACPI tables are not parsed. */
-int opt_noacpi=0;
-/* opt_nosmp: If true, secondary processors are ignored. */
-int opt_nosmp=0;
-/* opt_noreboot: If true, machine will need manual reset on error. */
-int opt_noreboot=0;
-/* opt_ignorebiostables: If true, ACPI and MP tables are ignored. */
-/* NB. This flag implies 'nosmp' and 'noacpi'. */
-int opt_ignorebiostables=0;
-/* opt_watchdog: If true, run a watchdog NMI on each processor. */
-int opt_watchdog=0;
-/* opt_pdb: Name of serial port for Xen pervasive debugger (and enable pdb) */
-unsigned char opt_pdb[10] = "none";
-/* opt_tbuf_size: trace buffer size (in pages) */
-unsigned int opt_tbuf_size = 10;
-/* opt_sched: scheduler - default to Borrowed Virtual Time */
-char opt_sched[10] = "bvt";
-/* opt_physdev_dom0_hide: list of PCI slots to hide from domain 0. */
-/* Format is '(%02x:%02x.%1x)(%02x:%02x.%1x)' and so on. */
-char opt_physdev_dom0_hide[200] = "";
-/* opt_leveltrigger, opt_edgetrigger: Force an IO-APIC-routed IRQ to be */
-/*                                    level- or edge-triggered.         */
-/* Example: 'leveltrigger=4,5,6,20 edgetrigger=21'. */
-char opt_leveltrigger[30] = "", opt_edgetrigger[30] = "";
-/*
- * opt_xenheap_megabytes: Size of Xen heap in megabytes, excluding the
- * pfn_info table and allocation bitmap.
- */
-unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
-/*
- * opt_nmi: one of 'ignore', 'dom0', or 'fatal'.
- *  fatal:  Xen prints diagnostic message and then hangs.
- *  dom0:   The NMI is virtualised to DOM0.
- *  ignore: The NMI error is cleared and ignored.
- */
-#ifdef NDEBUG
-char opt_nmi[10] = "dom0";
-#else
-char opt_nmi[10] = "fatal";
-#endif
-/*
- * Comma-separated list of hexadecimal page numbers containing bad bytes.
- * e.g. 'badpage=0x3f45,0x8a321'.
- */
-char opt_badpage[100] = "";
-
-static struct {
-    unsigned char *name;
-    enum { OPT_STR, OPT_UINT, OPT_BOOL } type;
-    void *var;
-    unsigned int len;
-} opts[] = {
-#define V(_x) &_x, sizeof(_x)
-    { "console",           OPT_STR,  V(opt_console) },
-    { "conswitch",         OPT_STR,  V(opt_conswitch) },
-    { "com1",              OPT_STR,  V(opt_com1) },
-    { "com2",              OPT_STR,  V(opt_com2) },
-    { "dom0_mem",          OPT_UINT, V(opt_dom0_mem) },
-    { "noht",              OPT_BOOL, V(opt_noht) },
-    { "noacpi",            OPT_BOOL, V(opt_noacpi) },
-    { "nosmp",             OPT_BOOL, V(opt_nosmp) },
-    { "noreboot",          OPT_BOOL, V(opt_noreboot) },
-    { "ignorebiostables",  OPT_BOOL, V(opt_ignorebiostables) },
-    { "watchdog",          OPT_BOOL, V(opt_watchdog) },
-    { "pdb",               OPT_STR,  V(opt_pdb) },
-    { "tbuf_size",         OPT_UINT, V(opt_tbuf_size) },
-    { "sched",             OPT_STR,  V(opt_sched) },
-    { "physdev_dom0_hide", OPT_STR,  V(opt_physdev_dom0_hide) },
-    { "leveltrigger",      OPT_STR,  V(opt_leveltrigger) },
-    { "edgetrigger",       OPT_STR,  V(opt_edgetrigger) },
-    { "xenheap_megabytes", OPT_UINT, V(opt_xenheap_megabytes) },
-    { "nmi",               OPT_STR,  V(opt_nmi) },
-    { "badpage",           OPT_STR,  V(opt_badpage) },
-    { NULL,                0,        NULL, 0 }
-};
-
-
 void cmain(multiboot_info_t *mbi)
 {
     unsigned long max_page;
     unsigned char *cmdline;
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     void *heap_start;
-    int i;
     unsigned long max_mem;
     unsigned long dom0_memory_start, dom0_memory_end;
     unsigned long initial_images_start, initial_images_end;
@@ -147,35 +62,42 @@ void cmain(multiboot_info_t *mbi)
     if ( cmdline != NULL )
     {
         unsigned char *opt_end, *opt;
-        while ( *cmdline == ' ' ) cmdline++;
+        struct kernel_param *param;
+        while ( *cmdline == ' ' )
+            cmdline++;
         cmdline = strchr(cmdline, ' '); /* skip the image name */
         while ( cmdline != NULL )
         {
-            while ( *cmdline == ' ' ) cmdline++;
-            if ( *cmdline == '\0' ) break;
+            while ( *cmdline == ' ' )
+                cmdline++;
+            if ( *cmdline == '\0' )
+                break;
             opt_end = strchr(cmdline, ' ');
-            if ( opt_end != NULL ) *opt_end++ = '\0';
+            if ( opt_end != NULL )
+                *opt_end++ = '\0';
             opt = strchr(cmdline, '=');
-            if ( opt != NULL ) *opt++ = '\0';
-            for ( i = 0; opts[i].name != NULL; i++ )
+            if ( opt != NULL )
+                *opt++ = '\0';
+            for ( param = &__setup_start; param != &__setup_end; param++ )
             {
-                if ( strcmp(opts[i].name, cmdline ) != 0 ) continue;
-                switch ( opts[i].type )
+                if ( strcmp(param->name, cmdline ) != 0 )
+                    continue;
+                switch ( param->type )
                 {
                 case OPT_STR:
                     if ( opt != NULL )
                     {
-                        strncpy(opts[i].var, opt, opts[i].len);
-                        ((char *)opts[i].var)[opts[i].len-1] = '\0';
+                        strncpy(param->var, opt, param->len);
+                        ((char *)param->var)[param->len-1] = '\0';
                     }
                     break;
                 case OPT_UINT:
                     if ( opt != NULL )
-                        *(unsigned int *)opts[i].var =
+                        *(unsigned int *)param->var =
                             simple_strtol(opt, (char **)&opt, 0);
                     break;
                 case OPT_BOOL:
-                    *(int *)opts[i].var = 1;
+                    *(int *)param->var = 1;
                     break;
                 }
             }
index c8c96dbee307a143b950c3bc7fde281d067378f9..7e7824219adbd1549f7426492854a547f7b25fc2 100644 (file)
 #include <xen/irq.h>
 #include <asm/domain_page.h>
 
-extern char opt_badpage[];
+/*
+ * Comma-separated list of hexadecimal page numbers containing bad bytes.
+ * e.g. 'badpage=0x3f45,0x8a321'.
+ */
+static char opt_badpage[100] = "";
+string_param("badpage", opt_badpage);
 
 /*********************
  * ALLOCATION BITMAP
index a2559e52230f7fcb58765d1ca4dfeb0191b48c53..c01b7f08050bac93942e83ba3d8c11e078cdc080 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <xen/config.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/sched.h>
@@ -697,11 +698,15 @@ long do_physdev_op(physdev_op_t *uop)
     return ret;
 }
 
+/* opt_physdev_dom0_hide: list of PCI slots to hide from domain 0. */
+/* Format is '(%02x:%02x.%1x)(%02x:%02x.%1x)' and so on. */
+static char opt_physdev_dom0_hide[200] = "";
+string_param("physdev_dom0_hide", opt_physdev_dom0_hide);
+
 /* Test if boot params specify this device should NOT be visible to DOM0
  * (e.g. so that another domain can control it instead) */
 int pcidev_dom0_hidden(struct pci_dev *dev)
 {
-    extern char opt_physdev_dom0_hide[];
     char cmp[10] = "(.......)";
     
     strncpy(&cmp[1], dev->slot_name, 7);
index 4aceef7d2ac02402d6b76af4ed12e4be0d56c396..8639e51465ad0dba6e06b21561be2c0850af5b43 100644 (file)
 #include <xen/trace.h>
 #include <public/sched_ctl.h>
 
+/* opt_sched: scheduler - default to Borrowed Virtual Time */
+static char opt_sched[10] = "bvt";
+string_param("sched", opt_sched);
+
 /*#define WAKE_HISTO*/
 /*#define BLOCKTIME_HISTO*/
 
@@ -481,8 +485,6 @@ void __init scheduler_init(void)
 
     schedule_data[0].idle = &idle0_task;
 
-    extern char opt_sched[];
-
     for ( i = 0; schedulers[i] != NULL; i++ )
     {
         ops = *schedulers[i];
index d4954256ce133229b60a2e82cf87cdd54bd8de4b..06547c67d1c24be634999c0ecb016f686fbe0313 100644 (file)
 #include <asm/atomic.h>
 #include <public/dom0_ops.h>
 
+/* opt_tbuf_size: trace buffer size (in pages) */
+static unsigned int opt_tbuf_size = 10;
+integer_param("tbuf_size", opt_tbuf_size);
+
 /* Pointers to the meta-data objects for all system trace buffers */
 struct t_buf *t_bufs[NR_CPUS];
 
@@ -43,7 +47,6 @@ int tb_init_done = 0;
  */
 void init_trace_bufs(void)
 {
-    extern int opt_tbuf_size;
     int           i, order;
     unsigned long nr_pages;
     char         *rawbuf;
@@ -102,10 +105,8 @@ void init_trace_bufs(void)
  */
 int get_tb_info(dom0_gettbufs_t *st)
 {
-    if(tb_init_done)
+    if ( tb_init_done )
     {
-        extern unsigned int opt_tbuf_size;
-        
         st->mach_addr = __pa(t_bufs[0]);
         st->size      = opt_tbuf_size * PAGE_SIZE;
         
index cb577409969c7e063f5c754e749e51b9e121b5b8..bcc2ffc2d74bfbda1b9f831206117c98369ffffa 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <stdarg.h>
 #include <xen/config.h>
+#include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/event.h>
 #include <xen/keyhandler.h>
 #include <asm/uaccess.h>
 
-extern unsigned char opt_console[], opt_conswitch[];
+/* opt_console: comma-separated list of console outputs. */
+static unsigned char opt_console[30] = "com1,vga";
+string_param("console", opt_console);
+
+/* opt_conswitch: a character pair controlling console switching. */
+/* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
+/* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
+/*         boots. Any other value, or omitting the char, enables auto-switch */
+static unsigned char opt_conswitch[5] = "a";
+string_param("conswitch", opt_conswitch);
 
 static int xpos, ypos;
 static unsigned char *video = __va(0xB8000);
index bdd1995f52ca8f3dbb4a60e1e00238971257d42b..43bae0b1a3d383cf616466eea4a62a0abfd3f4fb 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <xen/config.h>
+#include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/keyhandler.h> 
 #include <asm/pdb.h>
 #include <xen/serial.h>
 #include <asm/io.h>
 
+/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
+static unsigned char opt_com1[30] = "", opt_com2[30] = "";
+string_param("com1", opt_com1);
+string_param("com2", opt_com2);
+
 /* Register offsets */
 #define RBR             0x00    /* receive buffer       */
 #define THR             0x00    /* transmit holding     */
@@ -280,8 +286,6 @@ static void uart_config_stage2(uart_t *uart)
 
 void serial_init_stage1(void)
 {
-    extern unsigned char opt_com1[], opt_com2[];
-
     parse_port_config(opt_com1, &com[0]);
     parse_port_config(opt_com2, &com[1]);
 
index 7e66567a5b81fd1d6fb02ac78da4f4793c2e38e4..ebf4f63e3076ce524d5dfbe1118f31086f26493f 100644 (file)
@@ -38,8 +38,6 @@
  * Also note, that this data cannot be "const".
  */
 
-#ifndef MODULE
-
 #ifndef __ASSEMBLY__
 
 /*
@@ -50,99 +48,64 @@ typedef void (*exitcall_t)(void);
 
 extern initcall_t __initcall_start, __initcall_end;
 
-#define __initcall(fn)                                                         \
-       static initcall_t __initcall_##fn __init_call = fn
-#define __exitcall(fn)                                                         \
-       static exitcall_t __exitcall_##fn __exit_call = fn
+#define __initcall(fn) \
+    static initcall_t __initcall_##fn __init_call = fn
+#define __exitcall(fn) \
+    static exitcall_t __exitcall_##fn __exit_call = fn
 
 /*
  * Used for kernel command line parameter setup
  */
 struct kernel_param {
-       const char *str;
-       int (*setup_func)(char *);
+    const char *name;
+    enum { OPT_STR, OPT_UINT, OPT_BOOL } type;
+    void *var;
+    unsigned int len;
 };
 
 extern struct kernel_param __setup_start, __setup_end;
 
-#define __setup(str, fn)                                                               \
-       static char __setup_str_##fn[] __initdata = str;                                \
-       static struct kernel_param __setup_##fn __attribute_used__ __initsetup = { __setup_str_##fn, fn }
-
+#define boolean_param(_name, _var) \
+    static char __setup_str_##_var[] __initdata = _name; \
+    static struct kernel_param __setup_##_var __attribute_used__ \
+        __initsetup = { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
+#define integer_param(_name, _var) \
+    static char __setup_str_##_var[] __initdata = _name; \
+    static struct kernel_param __setup_##_var __attribute_used__ \
+        __initsetup = { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
+#define string_param(_name, _var) \
+    static char __setup_str_##_var[] __initdata = _name; \
+    static struct kernel_param __setup_##_var __attribute_used__ \
+        __initsetup = { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
+
+#define __setup(_name, _fn)
+    
 #endif /* __ASSEMBLY__ */
 
 /*
  * Mark functions and data as being only used at initialization
  * or exit time.
  */
-#define __init         __attribute__ ((__section__ (".text.init")))
-#define __exit         __attribute_used__ __attribute__ ((__section__(".text.exit")))
-#define __initdata     __attribute__ ((__section__ (".data.init")))
-#define __exitdata     __attribute_used__ __attribute__ ((__section__ (".data.exit")))
-#define __initsetup    __attribute_used__ __attribute__ ((__section__ (".setup.init")))
-#define __init_call    __attribute_used__ __attribute__ ((__section__ (".initcall.init")))
-#define __exit_call    __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
+#define __init       \
+    __attribute__ ((__section__ (".text.init")))
+#define __exit       \
+    __attribute_used__ __attribute__ ((__section__(".text.exit")))
+#define __initdata   \
+    __attribute__ ((__section__ (".data.init")))
+#define __exitdata   \
+    __attribute_used__ __attribute__ ((__section__ (".data.exit")))
+#define __initsetup  \
+    __attribute_used__ __attribute__ ((__section__ (".setup.init")))
+#define __init_call  \
+    __attribute_used__ __attribute__ ((__section__ (".initcall.init")))
+#define __exit_call  \
+    __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
 
 /* For assembly routines */
 #define __INIT         .section        ".text.init","ax"
 #define __FINIT                .previous
 #define __INITDATA     .section        ".data.init","aw"
 
-/**
- * module_init() - driver initialization entry point
- * @x: function to be run at kernel boot time or module insertion
- * 
- * module_init() will add the driver initialization routine in
- * the "__initcall.int" code segment if the driver is checked as
- * "y" or static, or else it will wrap the driver initialization
- * routine with init_module() which is used by insmod and
- * modprobe when the driver is used as a module.
- */
-#define module_init(x) __initcall(x);
-
-/**
- * module_exit() - driver exit entry point
- * @x: function to be run when driver is removed
- * 
- * module_exit() will wrap the driver clean-up code
- * with cleanup_module() when used with rmmod when
- * the driver is a module.  If the driver is statically
- * compiled into the kernel, module_exit() has no effect.
- */
-#define module_exit(x) __exitcall(x);
-
-#else
-
-#define __init
-#define __exit
-#define __initdata
-#define __exitdata
-#define __initcall(fn)
-/* For assembly routines */
-#define __INIT
-#define __FINIT
-#define __INITDATA
-
-/* These macros create a dummy inline: gcc 2.9x does not count alias
- as usage, hence the `unused function' warning when __init functions
- are declared static. We use the dummy __*_module_inline functions
- both to kill the warning and check the type of the init/cleanup
- function. */
-typedef int (*__init_module_func_t)(void);
-typedef void (*__cleanup_module_func_t)(void);
-#define module_init(x) \
-       int init_module(void) __attribute__((alias(#x))); \
-       static inline __init_module_func_t __init_module_inline(void) \
-       { return x; }
-#define module_exit(x) \
-       void cleanup_module(void) __attribute__((alias(#x))); \
-       static inline __cleanup_module_func_t __cleanup_module_inline(void) \
-       { return x; }
-
-#define __setup(str,func) /* nothing */
-
-#endif
-
 #ifdef CONFIG_HOTPLUG
 #define __devinit
 #define __devinitdata
@@ -155,16 +118,4 @@ typedef void (*__cleanup_module_func_t)(void);
 #define __devexitdata __exitdata
 #endif
 
-/* Functions marked as __devexit may be discarded at kernel link time, depending
-   on config options.  Newer versions of binutils detect references from
-   retained sections to discarded sections and flag an error.  Pointers to
-   __devexit functions must use __devexit_p(function_name), the wrapper will
-   insert either the function_name or NULL, depending on the config options.
- */
-#if defined(MODULE) || defined(CONFIG_HOTPLUG)
-#define __devexit_p(x) x
-#else
-#define __devexit_p(x) NULL
-#endif
-
 #endif /* _LINUX_INIT_H */